package com.demo.udp;import javafx.beans.binding.When;import java.net.DatagramPacket;import java.net.DatagramSocket;import java.net.InetAddress;import java.net.SocketException;import java.util.Scanner;public class Send {    public static void main(String[] args) throws Exception {        Scanner sc = new Scanner(System.in);        DatagramSocket socket = new DatagramSocket();        while (true) {            String str = sc.next();            if("quit".equals(str)){                break;            }            DatagramPacket dp = new DatagramPacket(str.getBytes(), str.getBytes().length, InetAddress.getByName("127.0.0.1"), 8866);            socket.send(dp);        }        socket.close();        sc.close();    }}